package com.example.bootDemo.oneTomany;


import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 一对多发送者
 *
 * @author zys20
 */
@Component
public class OneToManySender {
    @Autowired
    private AmqpTemplate rabbitmq;

    public void send(int i) {
        String context = "OneToMany Spring Boot queue + " + " *********** " + i;
        System.out.println("Sender : " + context);
        rabbitmq.convertAndSend("oneToMany", context);
    }
}
